package mk.jug.academy.preconditions;

import mk.jug.academy.model.Comment;
import mk.jug.academy.model.Content;

import org.springframework.util.Assert;


/**
 * Class separating the concerns of checking preconditions for
 * regarding a {@link Comment}.
 * 
 * It is usually a Precondition <-> Service pair.
 *
 * @author Ice.Penov
 */
public final class CommentPreconditions {
	
	private CommentPreconditions() {;}
	
	public static void add(Comment comment, Content content) {
		Assert.notNull(content.getId(), PreconditionExceptions.ID_IS_NULL);
		Assert.notNull(comment.getContent(), PreconditionExceptions.CONTENT_IS_NULL);
	}
	
	public static void delete(Comment comment) {
		Assert.notNull(comment.getId(), PreconditionExceptions.ID_IS_NULL);
		Assert.notNull(comment.getContentID(), PreconditionExceptions.CONTENT_ID_IS_NULL);
	}

}
